/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.goods.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.file.utils.FileUploadUtils;
import com.jeesite.modules.goods.dao.ZtAddrDao;
import com.jeesite.modules.goods.entity.ZtAddr;
import com.jeesite.modules.goods.entity.ZtQuanself;

/**
 * 测试数据Service
 * 
 * @author ThinkGem
 * @version 2018-04-22
 */
@Service
@Transactional(readOnly = true)
public class ZtAddrService extends CrudService<ZtAddrDao, ZtAddr> {
	
	
	
	/**
	 * 获取单条数据
	 * 
	 * @param testData
	 * @return
	 */
	@Override
	public ZtAddr get(ZtAddr ztAddr) {
		ZtAddr entity = super.get(ztAddr);
		if (entity == null) {
			entity = new ZtAddr();
		}
		return entity;
	}

	public int findCountNum(ZtAddr ztAddr){
		return dao.findCountNum(ztAddr);
	}
	public ZtAddr getDefaultAddr(ZtAddr ztAddr) {
		return dao.getDefaultAddr(ztAddr);
	}
	
	/**
	 * 查询分页数据
	 * 
	 * @param page
	 *            分页对象
	 * @param testData
	 * @return
	 */
	@Override
	public Page<ZtAddr> findPage(Page<ZtAddr> page, ZtAddr ztAddr) {
		return super.findPage(page, ztAddr);
	}
	public List<ZtAddr> findAddrList(ZtAddr ztAddr) {
		return dao.findAddrList(ztAddr);
	}
	

	/**
	 * 保存数据（插入或更新）
	 * 
	 * @param testData
	 */
	@Override
	@Transactional(readOnly = false)
	public void save(ZtAddr ztAddr) {
		super.save(ztAddr);
		
	}


	/**
	 * 删除数据
	 * 
	 * @param testData
	 */
	@Override
	@Transactional(readOnly = false)
	public void delete(ZtAddr ztAddr) {
		super.delete(ztAddr);
	}
	
	
	@Transactional(readOnly = false)
	public void setDefStatus(ZtAddr ztAddr) {
		
		dao.setAllStatus(ztAddr);
		
		dao.setDefStatus(ztAddr);
	}
	@Transactional(readOnly = false)
	public void setAllStatus(ZtAddr ztAddr) {

		dao.setAllStatus(ztAddr);

	}
	

}